#!/usr/bin/env node
//.trim()
const superagent = require('superagent');
const urlencode = require('urlencode')
const inquirer = require('inquirer');

const questions = [
    {
        type:'input',
        name:'star' ,
        message:'请输入要查询的星座'
    }
]
inquirer.prompt(questions).then((answers) =>{
    console.log()
    superagent
  .get(`http://web.juhe.cn:8080/constellation/getAll?key=1e86cbe4ac7c8e1d23dcc5a133221f7b &type=today&consName=${urlencode(answers.star)}`)
  .set('accept', 'json')
  .end((err, res) => {
      console.log(res.text)
    // Calling the end function will send the request
  });
})

